﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	mc:Ignorable="d"
	x:Class="Coding4Fun.Obd.InstrumentCluster.Controls.Blinker"
	x:Name="UserControl">
   <UserControl.ContentTemplate>
      <DataTemplate>
      	<DataTemplate.Resources>
      		<Storyboard x:Key="uxSB_Blink">
      			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="uxBorder" RepeatBehavior="Forever">
      				<DiscreteObjectKeyFrame KeyTime="0:0:0.4" Value="{x:Static Visibility.Hidden}"/>
      				<DiscreteObjectKeyFrame KeyTime="0:0:0.8" Value="{x:Static Visibility.Visible}"/>
      			</ObjectAnimationUsingKeyFrames>
      		</Storyboard>
      	</DataTemplate.Resources>
         <Border x:Name="uxBorder">
            <ContentPresenter Content="{TemplateBinding Content}"/>
         </Border>
      	<DataTemplate.Triggers>
      		<EventTrigger RoutedEvent="FrameworkElement.Loaded">
      			<BeginStoryboard Storyboard="{StaticResource uxSB_Blink}"/>
      		</EventTrigger>
      	</DataTemplate.Triggers>
      </DataTemplate>
   </UserControl.ContentTemplate>
</UserControl>